import uvicorn
from fastapi import FastAPI
from routers import router
from api.index import lifespan
import logging

# 配置日志
logging.basicConfig(level=logging.INFO)

app = FastAPI(
    title="STEEL DEFECT DETECTION API",
    description="使用TensorRT加速的钢材缺陷检测API",
    version="1.0.0",
    lifespan=lifespan
)

app.include_router(router)

if __name__ == "__main__":
    uvicorn.run("main:app", host="127.0.0.1", port=8000, reload=True)